package logbrowse;

public class LogEntry {
	private int index;
	private String date;
	private boolean forced;
	private String msg;
	private String text;
	private int lineCount;
	private int mods;
	
	public LogEntry(int index, String date, boolean forced, String msg, String text, int mods) {
		this.index = index;
		this.date = date;
		this.forced = forced;
		this.msg = msg;
		this.text = text;
		this.mods = mods;
		
		String[] lines = text.split("\n");
		int lineCount = lines.length;
		while (lineCount > 0 && lines[lineCount - 1].equals("")) {
			lineCount--;
		}
		this.lineCount = lineCount;
	}
	
	public int getIndex() {
		return index;
	}
	
	public String getDate() {
		return date;
	}
	
	public boolean isForced() {
		return forced;
	}
	
	public String getErrorMessage() {
		return msg;
	}
	
	public String getText() {
		return text;
	}
	
	public int getModificationCount() {
		return mods;
	}
	
	public int getLineCount() {
		return lineCount;
	}
}
